class Alg<E extends Comparable<E>>{
    public E findMax(E[] array){
        E max = array[0];
        for (int i = 0; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max = array[i];
            }
        }
        return max;
    }
}

class Alg2{
    public <E extends Comparable<E>>E findMax(E[] array){
        E max = array[0];
        for (int i = 0; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max = array[i];
            }
        }
        return max;
    }
}
public class Find {


    public static void main(String[] args) {
        Integer []array = {21,1,35,6,6};
        Alg <Integer>alg = new Alg<>();
        int ret = alg.findMax(array);
        System.out.println(ret);
        Alg2 alg2 = new Alg2();
        int ret2 = alg2.findMax(array);
        System.out.println(ret2);

    }
}
